(* node.pp *)

unit nodes;

interface

type 	
link = ^node;
   info	= record
	     tag   : boolean;
	     suit  : ShortString;
	     rank  : integer;
	     title : ShortString;
	  end;	 	   
   node	= record
	     item : info;
             next : link;
	  end;	  
var
   NodesTab : array[1..52] of node;
   top	    : link; (* wierzcholek stosu *)
NodesNr : integer;
function ReadData(fn : ShortString) : integer;
procedure print(t : link);

implementation
   
function ReadData(fn : ShortString) : integer;
var
   i : integer;
   fin : file of info;
begin
   assign(fin, fn);
   reset(fin);
i := 0;
   while not eof(fin) do	
begin 
i := i+1;
read(fin, NodesTab[i].item);
end;
   close(fin);
ReadData := i;
end; { ReadData }

procedure print(t : link);
begin
   writeln(t^.item.tag, ' ', t^.item.suit, ' ',t^.item.rank, ' ',t^.item.title);
end; { print }

end.
